package com.quickask.idao;

import com.quickask.common.Pager;
import com.quickask.entity.AsknowQuestionClassifyEntity;
import com.quickask.entity.AsknowQuestionLocationSetEntity;
import com.quickask.entity.AsknowQuestionSetEntity;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2015/9/30.
 */
public interface IQuestionSetDao {

    /**
     * 添加问题实体
     * @param asknowQuestionSetEntity 问题实体
     * @return
     */
    public void addQuestionEntity(AsknowQuestionSetEntity asknowQuestionSetEntity);

    /**
     * 为问题添加最佳答案
     * @param questionId 问题id
     * @param answerId 最佳答案id
     * @return
     */
    public int addFavouriteAnswer(int questionId, int answerId);

    /**
     * 更新问题同问数
     * @param questionId
     * @return
     */
    public int updateQuestionAsknum(int questionId);

    /**
     * 更新问题答案数
     * @param questionId
     * @return
     */
    public int updateQuestionAnswernum(int questionId);


    /**
     * 获取用户问题列表
     * param pageNo 页码
     * @param pageSize 页大小
     * @param userId 用户id
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionListByUserId(int pageNo, int pageSize, int userId);


    /**
     * 根据问题id获取问题分页
     * @param pageNo 页码
     * @param pageSize 页大小
     * @param questionId 问题id
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerByQuestionId(int pageNo, int pageSize, int questionId);

    /**
     * 获取用户问题列表
     * @param pageNo 页码
     * @param pageSize 页大小
     * @param userId 用户id
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerByUserId(int pageNo, int pageSize, int userId);


    /**
     * 根据问题的提问时间获取问题分页
     * @param pageNo
     * @param pageSize
     * @param properties (latitude,longitude,blockCode...)
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerByGeohash(int pageNo, int pageSize, Map<String, Object> properties);

    /**
     * 根据问题的提问时间获取问题分页,下拉刷新
     * @param pageNo
     * @param pageSize
     * @param questionId
     * @param properties
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerByGeohashRefresh(int pageNo, int pageSize, int questionId, Map<String, Object> properties);

    /**
     * 根据问题的提问时间获取问题分页
     * @param pageNo
     * @param pageSize
     * @param properties (latitude,longitude,blockCode...)
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionListOrderByAskTime(int pageNo, int pageSize, Map<String, Object> properties);

    /**
     * 根据问题的提问时间获取问题分页,刷新
     * @param pageNo
     * @param pageSize
     * @param askTime
     * @param properties
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionListOrderByAskTimeRefresh(int pageNo, int pageSize, Timestamp askTime, Map<String, Object> properties);

    /**
     * 根据问题的积分数获取问题分页
     * @param pageNo
     * @param pageSize
     * @param properties
     * @param properties (latitude,longitude,blockCode...)
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionListOrderByQuestionPoint(int pageNo, int pageSize, Map<String, Object> properties);

    /**
     * 根据问题的积分数获取问题分页,下拉刷新
     * @param pageNo
     * @param pageSize
     * @param questionPoint
     * @param askTime
     * @param properties
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionListOrderByQuestionPointRefresh(int pageNo, int pageSize,int questionPoint, Timestamp askTime, Map<String, Object> properties);


    /**
     * 根据问题答案数获取问题分页
     * @param pageNo
     * @param pageSize
     * @param properties (latitude,longitude,blockCode...)
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerOrderByAnswernum(int pageNo, int pageSize, Map<String, Object> properties);


    /**
     * 根据问题答案数获取问题分页,下拉刷新
     * @param pageNo
     * @param pageSize
     * @param answernum
     * @param askTime
     * @param properties
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerOrderByAnswernumRefresh(int pageNo, int pageSize,int answernum, Timestamp askTime, Map<String, Object> properties);


    /**
     * 根据问题同问数获取问题分页
     * @param pageNo
     * @param pageSize
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerByAsknum(int pageNo, int pageSize, Map<String, Object> properties);

    /**
     * 根据问题同问数获取问题分页,下拉刷新
     * @param pageNo
     * @param pageSize
     * @param asknum
     * @param askTime
     * @param properties
     * @return
     */
    public Pager<AsknowQuestionSetEntity> getQuestionPagerByAsknumRefresh(int pageNo, int pageSize, int asknum, Timestamp askTime, Map<String, Object> properties);

}
